package entity

import (
	"time"
	"xr-game-server/core/constants/db"
	"xr-game-server/core/migrate"
)

const (
	TbServer db.TbName = "servers"
)

// 列名
const (
	ServerName     db.TbCol = "name"
	ServerStaus    db.TbCol = "status"
	ServerZoneId   db.TbCol = "zone_id"
	ServerOpenTime db.TbCol = "open_time"
)

type Server struct {
	migrate.OneModel
	Name     string     `gorm:"comment:名称" json:"name"`
	Status   uint8      `gorm:"default:1;comment:状态" json:"status"`
	ZoneId   uint64     `gorm:"comment:所属区" json:"zoneId"`
	Remark   string     `gorm:"comment:备注" json:"remark"`
	OpenTime *time.Time `gorm:"comment:开放时间" json:"openTime"`
}

func initServer() {
	migrate.AutoMigrate(&Server{})
}
